package cn.codingtalk.tacomallmiddleplatformbizmember.controller;

import java.io.Serializable;

import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import cn.codingtalk.tacomallcommon.dto.ReturnDto;
import cn.codingtalk.tacomallmiddleplatformbizmember.mapper.get.GetMemberMapper;


@RestController
@RequestMapping("/member")
public class MemberController {
    @Autowired
    private GetMemberMapper getMemberMapper;

    @PostMapping("/findById")
    public ReturnDto findById(@RequestBody JSONObject jsonObject){
        try {
            Thread.sleep(1000*5);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        ReturnDto returnDto = new ReturnDto();
        returnDto.setData(this.getMemberMapper.selectById((Serializable) jsonObject.get("id")));
        return returnDto;
    }
}

